﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Scheduler;
using UnitTesting.Result;

namespace UnitTesting.Engine
{
    public class Tester
    {
        private readonly Scheduler.Scheduler _scheduler;
        private readonly TestingContext _ctx;
        public event EventHandler<ChipResult> OnThisPassDone;

        public Tester(
            List<Middleware> middleWares  
             )
        {
            _scheduler = new SchedulerBuilder().BuildScheduler( new List<int> { 0 });
       
            _ctx = new TestingContext();// { EsdSetting = esdSetting };

          



        }
        public Task Run()
        {
            return _scheduler.Execute(_ctx);
        }

        public void Stop()
        {
            _ctx.UserCancelled = true;
        }
    }
}